import { ref, computed } from "vue";
import { defineStore } from "pinia";

// 在需要使用的方法就可以直接其定义的变量和方法:
// import {userCartStore} from '@stores'
// const useCart = userCartStore()

export const useCartStore = defineStore("cart", () => {
    const count = ref(0);
    const doubleCount = computed(() => count.value * 2);
    function increment() {
        count.value++;
    }
    return { count, doubleCount, increment };
});
